﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Infrastructure;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;

namespace OpenAuth.Mvc.Controllers
{
    public class MST_MATECODEController : BaseController
    {
        private MST_MATECODEApp _mast_MateCodeApp;
        public MST_MATECODEController( IAuth auth, MST_MATECODEApp app) : base(auth) {
            _mast_MateCodeApp = app;
        }
         
        public IActionResult Index()
        {
            return View();
        }
        //  public async Task<TableData> Load([FromQuery] QueryFormListReq request)
        public async Task<string> loadMst_MateCode([FromQuery] MST_MATECODEListReq request)
        {
            TableData data = new TableData();
            data = await _mast_MateCodeApp.Load(request);
            return JsonHelper.Instance.Serialize(data);
        }
        public async Task<string> Load_IsNode([FromQuery] MST_MATECODEListReq request) {
            TableData data = new TableData();
            data = await _mast_MateCodeApp.LoadNode(request);
            return JsonHelper.Instance.Serialize(data);
        }
    }
}
